/**
 *
 * @author DnD Binary Source
 */
package binarysource;

import org.jdesktop.application.Action;
import javax.swing.table.DefaultTableModel;
import javax.swing.JFrame;

public class HomebrewEditor extends javax.swing.JFrame {

    /** Creates new form JFAdmin */
    public HomebrewEditor() {
        initComponents();
    }
    
    public void setComponents(){
        
    }
    
    @Action
    public void exit() {
        dispose();
    }
    
    @Action
    public void showStartScreen() {
        this.setVisible(false);
        BinarySource.getApplication().show(StartScreen.getInstance());
    }
    
    // Action method used by the Buttons to show the Add Homebrew:
    @Action
    public void showAddHomebrew() {
        if (addHomebrew == null) {
            JFrame mainFrame = BinarySource.getApplication().getMainFrame();
            addHomebrew = AddHomebrew.getInstance();
            addHomebrew.setLocationRelativeTo(mainFrame);
        }
        // Showing the Add Book screen:
        BinarySource.getApplication().show(addHomebrew);
    }
    
    // Action method used by the Buttons to show the Edit Homebrew:
    @Action
    public void showEditHomebrew() {
        if (editHomebrew == null) {
            JFrame mainFrame = BinarySource.getApplication().getMainFrame();
            editHomebrew = new EditHomebrew();
            editHomebrew.setLocationRelativeTo(mainFrame);
        }
        // Showing the Add Book screen:
        BinarySource.getApplication().show(editHomebrew);
    }
    
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panHomebrewEditor = new javax.swing.JPanel();
        labTitle = new javax.swing.JLabel();
        btnAdd = new javax.swing.JButton();
        btnEditItem = new javax.swing.JButton();
        btnEditRules = new javax.swing.JButton();
        btnClose = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Homebrew Editor - DnD Binary Source");
        setBounds(new java.awt.Rectangle(400, 185, 200, 200));
        setMinimumSize(new java.awt.Dimension(308, 180));
        setName("Admin"); // NOI18N
        setResizable(false);

        panHomebrewEditor.setBackground(new java.awt.Color(226, 230, 233));
        panHomebrewEditor.setMaximumSize(new java.awt.Dimension(32767, 180));

        labTitle.setFont(new java.awt.Font("Old English Text MT", 1, 36)); // NOI18N
        labTitle.setText("Homebrew Editor");

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance().getContext().getActionMap(HomebrewEditor.class, this);
        btnAdd.setAction(actionMap.get("showAddHomebrew")); // NOI18N
        btnAdd.setText("Add Item");
        btnAdd.setToolTipText("Add Homebrew Item");

        btnEditItem.setAction(actionMap.get("showEditHomebrew")); // NOI18N
        btnEditItem.setText("Edit Item");
        btnEditItem.setToolTipText("Edit Homebrew Item");

        btnEditRules.setAction(actionMap.get("showEditHomebrew")); // NOI18N
        btnEditRules.setText("Edit Rules");
        btnEditRules.setToolTipText("Edit Homebrew Ruleset");

        btnClose.setAction(actionMap.get("exit")); // NOI18N
        btnClose.setText("Close");
        btnClose.setToolTipText("Close the Homebrew Editor");

        javax.swing.GroupLayout panHomebrewEditorLayout = new javax.swing.GroupLayout(panHomebrewEditor);
        panHomebrewEditor.setLayout(panHomebrewEditorLayout);
        panHomebrewEditorLayout.setHorizontalGroup(
            panHomebrewEditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panHomebrewEditorLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panHomebrewEditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(labTitle)
                    .addGroup(panHomebrewEditorLayout.createSequentialGroup()
                        .addComponent(btnAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 72, Short.MAX_VALUE)
                        .addComponent(btnEditItem, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panHomebrewEditorLayout.createSequentialGroup()
                        .addComponent(btnEditRules, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 106, Short.MAX_VALUE)
                        .addComponent(btnClose, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        panHomebrewEditorLayout.setVerticalGroup(
            panHomebrewEditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panHomebrewEditorLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(labTitle)
                .addGap(27, 27, 27)
                .addGroup(panHomebrewEditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnEditItem, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 56, Short.MAX_VALUE)
                .addGroup(panHomebrewEditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(btnClose)
                    .addComponent(btnEditRules, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panHomebrewEditor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panHomebrewEditor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        getAccessibleContext().setAccessibleDescription("Homebrew Editor - DnD Binary Source");

        pack();
    }// </editor-fold>//GEN-END:initComponents
 
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new HomebrewEditor().setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAdd;
    private javax.swing.JButton btnClose;
    private javax.swing.JButton btnEditItem;
    private javax.swing.JButton btnEditRules;
    private javax.swing.JLabel labTitle;
    private javax.swing.JPanel panHomebrewEditor;
    // End of variables declaration//GEN-END:variables
    private JFrame addHomebrew;
    private JFrame editHomebrew;
}
